import Cookies from 'js-cookie'

const TokenKey = 'token'
const UserInfo = 'userInfo'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

//获取用户登录信息
export function getUserInfo() {
  // alert('getUserInfo')
  return Cookies.get(UserInfo)
}

//存储用户登录的信息
export function setUserInfo(userInfo) {
  return Cookies.set(UserInfo, userInfo)
}

//清除用户登录信息
export function removeUserInfo() {
  // alert('removeUserinfo')
  return Cookies.remove(UserInfo)
}
